#include <vector>
using namespace std;
class Solution {
public:
    vector<int> twoSum(vector<int>& price, int target) {
        int left = 0, right = price.size() - 1;
        while (left < right)
        {
            if (price[left] + price[right] > target)
            {
                right--;
            }
            else if (price[left] + price[right] < target)
            {
                left++;
            }
<<<<<<< HEAD
            else return { price[left],price[right] };
        }
=======
            else {
                break;
            }
        }
        vector<int> v;
        v.push_back(price[left]);
        v.push_back(price[right]);
        return v;
>>>>>>> cf7e3fc2d3d67cd1a2dbd9a14773c8d15f48298f
    }
};